package com.xf.system.common.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xf.system.constants.DateConst;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author xiefengf
 * @version 1.0
 */
@Data
public class BaseModel implements Serializable {

    @Schema(description = "主键id")
    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "删除标志（0代表存在 1代表删除）")
    @TableLogic
    @TableField(value = "del_flag")
    private String delFlag;

    @Schema(description = "备注")
    @TableField(value = "remark")
    private String remark;

    @Schema(description = "创建者")
    private String createBy;

    @Schema(description = "更新者")
    private String updateBy;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = DateConst.SIMPLE, timezone = DateConst.TIME_ZONE_GMT8)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = DateConst.SIMPLE, timezone = DateConst.TIME_ZONE_GMT8)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

}
